<?php

declare (strict_types=1);
namespace App\Model;

/**
 * @property int $id 
 * @property string $order_sn 
 * @property int $user_id 
 * @property int $patient_id 
 * @property string $description 
 * @property int $doctor_id 
 * @property int $amount 
 * @property string $paid 
 * @property string $pay_type 
 * @property string $refund 
 * @property string $refund_reason 
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 */
class PatientOrder extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'patient_order';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'integer', 'user_id' => 'integer', 'patient_id' => 'integer', 'doctor_id' => 'integer', 'amount' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    /**
     *
     * @param $id 修改记录ID
     * @return
    */
    public function getOne(int $id)
    {
        return $this->getInfo($id);
    }

    public function getOrderList(array $where)
    {
        return $this->getInfoByWhere($where,true);
    }
    public function saveOne($data)
    {
        return $this->saveInfo($data,false);
    }
}